/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2003-2011,  Jin Chen and Alan M. MacEachren, GeoVISTA Center, Penn State University
 * All Rights Researved.
 *
 * This library is developed and distributed for free usage,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * You can redistribute and/or modify it under the terms of the
 * Simplified BSD License
 *
 *
 *
 *
 *
 *
 *
 *
 * @Original Author: jin Chen
 * @date: Dec 3, 2003$
 * @version: 1.0
 */
package edu.psu.geovista.app.dataloader.v1.session;

import java.util.Date;
import java.util.Properties;

public class Project implements Comparable{
    private String id;
    private Properties paths=new Properties();
    private DataInfo datainfo=new DataInfo();
    private Date time;

    public Project() {
    }

    public Project(String id) {
        this.id = id;
    }

    public Project(String id, Date time) {
        this.id = id;
        this.time = time;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Properties getPaths() {
        return paths;
    }
    public void addPaths(Properties paths)  {
        /*Enumeration names= paths.keys();
        while (names.hasMoreElements()) {
            String name = (String) names.nextElement();
            String path=paths.getProperty(name);
            this.paths.setProperty(name,path);

        }
*/
        datainfo.addPaths(paths);
    }
    public void setPaths(Properties paths) {
      /*  this.paths = paths;*/
        datainfo.setDatapaths(paths);
    }
    public String getPaths(String name) {
        //return paths.getProperty(name) ;
        return datainfo.getDatapaths().getProperty(name) ;
    }

    public void setPath(String pname,String pvalue) {
        //this.paths.setProperty(pname,pvalue);
        datainfo.getDatapaths().setProperty(pname,pvalue);
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public int compareTo(Object o) {
        Project another=(Project) o;
       return this.getTime().compareTo(another.getTime() );
    }

}
